import { LightningElement } from 'lwc';
import { data1, data2, freezeColumns, columns } from './data';

export default class TestLwcIfParent extends LightningElement {

    records = [];
    columns = columns;
    freezeColumns = freezeColumns;

    loadData(){
        if(Math.ceil(Math.random() * 10) % 2 == 0) {
            this.records = JSON.parse(JSON.stringify(data1));
        } else {
            this.records = JSON.parse(JSON.stringify(data2));
        }
        this.template.querySelector('c-test-lwc-if').reloadData(this.records);
    }

}